﻿@using HZT.Framework.Contract
@using HZT.Framework.Web,
@using AD.Contract.Models
@using AD.WebEx
@model  ADBill
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
    ViewBag.Title = "广告业务录入";
}
@section PageSpecificJavascriptIncludes{
    <script type="text/javascript">
        $(document).ready(function () {
            var dates = $("#StartDate, #EndDate").datepicker({
                dateFormat: "yy-mm-dd",
                defaultDate: new Date().getDate(),
                changeMonth: true,
                numberOfMonths: 1,
                onSelect: function (selectedDate) {
                    var option = this.id == "startDate" ? "minDate" : "maxDate",
					instance = $(this).data("datepicker"),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings);
                    dates.not(this).datepicker("option", option, date);
                }
            });

        });

        function getTime(value) {
            var hours = value;
            if (hours < 10) hours = '0' + hours;
            return hours + ':00';
        } 
    </script>
}
<div class="portlet-body form-horizontal form-bordered form-row-stripped">
    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "mainForm" }))
    { 
        <div class="row-fluid">
            <div class="control-group">
                <label class="control-label">
                    <span class="required">*</span>所属部门:</label>
                <div class="controls">
                    @Html.HiddenFor(m => m.Id)
                    @Html.DropDownListFor(m => m.DepartmentId, ViewData["DepartmentId"] as SelectList, "--请选择--", new { @class = "my-select-css-class" })
                    <span class="help-inline">@Html.ValidationMessageFor(m => m.DepartmentId)</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required">*</span>客户名称:</label>
                <div class="controls">
                    @Html.HiddenFor(m => m.CustomerId)
                    @Html.TextBoxFor(m => m.customer.Name)
                    <a class="btn blue thickbox" title='选择' href="@Url.Action("SelectCustomer")?TB_iframe=true&height=400&width=600">
                        <i class="icon-white"></i>选择</a> <span class="help-inline">@Html.ValidationMessageFor(m => m.CustomerId)</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required">*</span>合同编号:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.ContractId)
                    <span class="help-inline">@Html.ValidationMessageFor(m => m.ContractId)</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>广告业务类别:</label>
                <div class="controls">
                    @Html.DropDownList("BusinessCategoryId", ViewData["BusinessCategoryId"] as SelectList, "--请选择--", new { @class = "my-select-css-class" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>广告发布项目:</label>
                <div class="controls">
                    @Html.DropDownList("ShowCategoryId", ViewData["BusinessCategoryId"] as SelectList, "--请选择--", new { @class = "my-select-css-class" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>广告内容:</label>
                <div class="controls">
                    @Html.TextAreaFor(m => m.ADContent, new { @style = " width:400px;" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>广告长度:</label>
                <div class="controls">
                    @Html.TextBox("TimeSpan", null, new { @class = "m-wrap small" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>播出起止日期:</label>
                <div class="controls">
                    @Html.TextBox("StartDate", null, new { @class = "m-wrap small" }) @Html.TextBox("EndDate", null, new { @class = "m-wrap small" })
                </div>
            </div>
            @* <div class="control-group">
            <label class="control-label">
                <span class="required"></span>广告类型:</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.ContractId)
            </div>
        </div>*@
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>播出时段:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.ShowPeriod)
                    @Html.TextBox("PeriodName")
                    <a class="btn blue thickbox" title='选择时段' href="@Url.Action("SelectPeriod")?TB_iframe=true&height=400&width=600">
                        <i class="icon-white"></i>选择时段</a>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required">*</span>播出次数:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.ShowTimes)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>制作费:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.ProduceMoney)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>播出费:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.PlayMoney)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required">*</span>合同金额:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.PurchaseMoney)
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    <span class="required">*</span>费用结算方式:</label>
                <div class="controls">
                    @Html.DropDownList("PayCategoryId", ViewData["PayCategoryId"] as SelectList, new { @class = "my-select-css-class" })
                </div>
            </div>
            @*    <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>预付款金额:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.PaidMoney)
                </div>
            </div>*@ @*<div class="control-group">
            <label class="control-label">
                <span class="required">*</span>合同约定付款日期:</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.ContractId)
            </div>
        </div>*@
            <div class="control-group">
                <label class="control-label">
                    <span class="required"></span>备注:</label>
                <div class="controls">
                    @Html.TextBoxFor(m => m.Comment, new { @style = " width:400px;" })
                </div>
            </div>
            <div class="control-group">
                <button type="submit" id="submit" class="btn blue">
                    <i class="icon-ok"></i>提交</button>
                <span id="submitloading" style="display: none;">
                    <img src='@Url.StaticFile("/content/images/loading.gif")'/></span>
                <button type="button" class="btn" id="cancel">
                    撤销</button>
                @Html.ValidationSummary(false)
            </div>
        </div>
    }
</div>
